let name = document.querySelector('.name')
let mail = document.querySelector('.mail')
let phone = document.querySelector('.Phone')

name.addEventListener('blur',function(){
    if(!this.value){
        alert('用户名不能为空')
        name.classList.add("error") 
    }else{
        name.classList.remove("error")
    }
})
mail.addEventListener('blur',function(){
    let rge = /^([a-zA-Z_0-9-])+@([a-zA-Z_0-9-])+(\.[a-zA-Z_0-9-])+/
    if(!this.value){
        alert('邮箱不能为空')
        mail.classList.add("error") 
        mail.classList.remove("Text")
    }else if(!rge.test(this.value)){
        alert('邮箱格式错误')
        mail.classList.add("error")
        mail.classList.remove("Text")
    }
    else{
        mail.classList.remove("error")
        mail.classList.add("Text")
    }
})
phone.addEventListener('blur',function(){
    let rge = /(^1[3|4|5|7|8][0-9]{9}$)/
    if(!this.value){
        alert('手机号不能为空')
        phone.classList.add("error") 
        phone.classList.remove("Text")
    }else if(!rge.test(this.value)){
        alert('手机号格式错误')
        phone.classList.add("error")
        phone.classList.remove("Text")
    }
    else{
        phone.classList.remove("error")
        phone.classList.add("Text")
    }
})

    //wow
    new WOW().init();
//end